/*DncIqBreQz6WZRX+v7OzgYtl1iEmq5jC4MuUyOKq4bc=*/


export default function afterEvent(that,key, value, moduleId,props, changedrows, i, s, g) {
    if (key == 'objtype') {
        let objArry = ['customer', 'supplier','pk_deptid','pk_psndoc'];
        for(let i = 0;i<objArry.length;i++){
            if(i ==value){
               this.props.search.changeItemVisibleByField(moduleId,objArry[i], true);
            }else{
                this.props.search.changeItemVisibleByField(moduleId,objArry[i],false);
            }
            this.props.search.setSearchValByField(moduleId, objArry[i], { display:null, value: null });
        }
        if(!value){
            this.props.search.changeItemVisibleByField(moduleId,objArry[0],false);
            if(that.state.schemeData.objType.value){
                this.props.search.changeItemVisibleByField(moduleId,objArry[that.state.schemeData.objType.value], true);
            }else if(that.state.verificationObj.value){
                this.props.search.changeItemVisibleByField(moduleId,objArry[that.state.verificationObj.value], true);
            }
            // this.props.search.setSearchValByField(moduleId, 'customer', { display:null, value: null });
            // this.props.search.setSearchValByField(moduleId, 'supplier', { display:null, value: null });
            // this.props.search.setSearchValByField(moduleId, 'pk_deptid', { display:null, value: null });
            // this.props.search.setSearchValByField(moduleId, 'pk_psndoc', { display:null, value: null });
        }
    }else {
        //let querycondition=this.props.search.getQueryInfo('query')['querycondition'].conditions;
        if(value&&value.refname==null&&value.refpk==null){
            if("billdate"==key){
                let time = [];
                time.push(value.value[0]);
                time.push(value.value[1]);
                let display=[];
                display.push(value.display[0])
                display.push(value.display[1])
                this.props.search.setSearchValByField('query', key,
                    { display:display, value: time });
            }else{
                if("pk_tradetypeid"==key){
                    that.state.schemeData.pk_tradetype.value='';
                }
            }
           
        }
    }
}

/*DncIqBreQz6WZRX+v7OzgYtl1iEmq5jC4MuUyOKq4bc=*/